import { BaseController, CoolController } from "@cool-midway/core";
import { ProviderProfileService } from "../../service/profile";
import { Body, Get, Inject, Post, Query } from "@midwayjs/core";
import { ProviderProfileEntity } from "../../entity/profile";

@CoolController({
    api: ['info', 'list', 'page'],
    entity: ProviderProfileEntity,
    service: ProviderProfileService,
})
export class AppProviderProfileController extends BaseController {
    @Inject()
    providerProfileService: ProviderProfileService;

    @Get('/weatherAndLocalTime', { summary: '获取服务人员常驻地的天气和时间' })
    async weatherAndLocalTime(@Query('providerId') providerId: number) {
        return this.ok(await this.providerProfileService.getWeatherAndLocalTime(providerId));
    }

}